﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;


namespace FXnaEngine.Physics
{
    /// <summary>
    /// Interface for all physics actors.
    /// </summary>
    public interface IPhysicsActor : IDisposable
    {
        /// <summary>
        /// Gets/sets the density of the actor.
        /// </summary>
        float Density { get; set; }

        /// <summary>
        /// Gets/sets the mass of the actor.
        /// </summary>
        float Mass { get; set; }

        /// <summary>
        /// Gets/sets the position of the actor.
        /// </summary>
        Vector3 Position { get; set; }

        /// <summary>
        /// Gets/set the orientation of the actor.
        /// </summary>
        Matrix Orientation { get; set; }

        Vector3 LinearVelocity { get; set; }

        Vector3 AngularVelocity { get; set; }

#if !XBOX
        VertexPositionColor[] BodyVerts { get; }
#endif //!XBOX

        /// <summary>
        /// Gets the list of shapes composing the actor.
        /// </summary>
        List<ShapeDesc> Shapes { get; }

        void EnableCollisionListening();

        void DisableCollisionListening();

        void AddForceFromOutsideSimulation(Vector3 force);

        void UpdateCollisions();

        void AddAdditionalForce(Vector3 force);

        bool HasAdditionalForce();

        void GetAdditionalForce(out Vector3 force);

        void SetMovable(bool movable);

        void ApplyLocalTransform(Vector3 position, Matrix rotation);

        BoundingBox GetBoundingBox();

        /// <summary>
        /// Make a CharacterBody jump. Only works on actors with a body of type 'CharacterBody'
        /// </summary>
        void CharacterDoJump();

        bool IsBodyActive();

        /// <summary>
        /// Called whenever this actor's <see cref="QSBody"/> is set to 'Active'
        /// </summary>
        void BodyActivated();

        /// <summary>
        /// Called whenever this actor's <see cref="QSBody"/> is set to 'Inactive'
        /// </summary>
        void BodyDeactivated();
    }
}
